package com.le.tester.javaThink.fifth.chapter14_StreamingProgramming;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;

/**
 * 描述：格式化内存输出
 */
public class FormattedMemoryInput {
    public static void main(String[] args) {
        try (DataInputStream inputStream = new DataInputStream(
                new ByteArrayInputStream(
                        BufferedInputFile.read(
                                "E:\\L.info\\L.Application\\L.Tester\\src\\main\\java\\com\\le\\tester\\java8\\chapter14_StreamingProgramming\\FormattedMemoryInput.java")
                                .getBytes()))) {
            while (true) {
                System.out.write((char) inputStream.readByte());
            }
        } catch (EOFException e) {
            System.out.println("\nEnd of stream");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }

}
